const http = require("http");
const path = require("path");
const middleare = require("./modulle/middleware");
const server = http.createServer((req,res)=>{
	middleare.static({
		// 静态资源目录
		pathUrl:path.join(__dirname,"/html"),
		req,
		res,
		next(){
			// 如果请求的地址不在静态资源目录内，执行该函数
			res.setHeader("Content-Type","text/html;charset=utf-8");
			res.end("404，不存在");
		}
	})
});
server.listen(8091,()=>{
	console.log("success");
})